@extends('admin::layouts.master')
@section('content')
    <div class="card" id="app">
        <div class="card-header">模块管理</div>
        <div class="tab-container">
            <ul role="tablist" class="nav nav-tabs">
                <li class="nav-item"><a href="/admin/module" class="nav-link active">模块列表</a></li>
                <li class="nav-item"><a href="/admin/updateCache" class="nav-link">更新模块</a></li>
            </ul>
            <div class="card card-contrast card-border-color-success">
                <div class="card-body">
                    <table class="table table-responsive" style="white-space: nowrap;">
                        <thead>
                        <tr>
                            <th style="width: 10%;">编号</th>
                            <th>模块名称</th>
                            <th>模块标识</th>
                            <th>是否默认</th>
                            <th>前台是否可访问</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach($data as $d)
                            <tr>
                                <td>{!! $d['id'] !!}</td>
                                <td>{!! $d['title'] !!}</td>
                                <td>{!! $d['name'] !!}</td>
                                <td>{!! $d['isdefault'] !!}</td>
                                <td>{!! $d['home_access'] !!}</td>
                                <td class="text-left">
                                    @if($d['home_access'])
                                        @if($d['isdefault'])
                                            <a href="javascript:;" class="btn btn-success">当前默认</a>
                                            @else
                                            <a href="/admin/setDefault/{{$d['name']}}" class="btn btn-secondary">设为默认</a>
                                            @endif
                                        @endif
                                </td>
                            </tr>
                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <div class="float-right">

    </div>
@endsection
